HAL ICACHE migration: List of applicable concepts

This section provides information about the HAL ICACHE applicable architecture concepts.

Concepts for ICACHE

Concept

Description

Unitary configuration APIs

New APIs are available to get and set ICACHE features.

Introduction of HAL user data set/get APIs

Two functions to set and get user data are available: HAL_ICACHE_GetMonitorHitValue(), HAL_ICACHE_GetMonitorMissValue().

Removal of hardware-related macros in HAL2

All hardware macros have been removed from the HAL ICACHE driver, and equivalent services are ensured through the LL APIs.

Revised and optimized HAL API status returns

The HAL ICACHE functions were updated to return:

  • HAL_INVALID_PARAM: in case of a NULL p_config structure pointer.

  • HAL_ERROR: in case of an error.

  • HAL_BUSY: in case of an ongoing process.

  • HAL_OK: in case of a successfully completed operation.

Revised and optimized HAL error management

Introduce a dedicated function for error management: HAL_ICACHE_GetLastErrorCodes().

Replaced TypeDef suffix with _t in type names

All TypeDef parts of the HAL ICACHE driver have been removed and replaced by _t.

Replaced nonmodifiable pointers with const keywords

Const keywords have been added to non-modifiable pointers to ensure that either the pointer itself or the data it points to cannot be modified. This enhances code safety and readability, prevents unintended modifications, and renders code more robust and maintainable.

Replace Finite Parameter Defines (Including PPP Instances) with Enum Types at HAL Levels.

Finite parameters (including ICACHE instances) have been converted into enumerated types (enums) at HAL level. This improves code readability, maintainability, and type safety.

Add HAL_PPP Prefix to All HAL Peripheral APIs (Defines, Macros, Types, and Functions).

All HAL ICACHE enumerations and structures start with hal_icache.

Other HAL ICACHE changes

Concept

Description

Rework the driver around the creation of a handle for the ICACHE.

Introduce hal_icache_handle_t for the ICACHE peripheral and add the following functions:

  • HAL_ICACHE_Init()

  • HAL_ICACHE_RegisterErrorCallback()

  • HAL_ICACHE_RegisterInvalidateCompleteCallback()

Rename the enable and disable functions.

  • HAL_ICACHE_Enable() has been renamed to HAL_ICACHE_Start()

  • HAL_ICACHE_Disable() has been renamed to HAL_ICACHE_Stop()

Rename the monitor functions.

  • HAL_ICACHE_Monitor_Start() has been renamed to HAL_ICACHE_EnableMonitors()

  • HAL_ICACHE_Monitor_Stop() has been renamed to HAL_ICACHE_DisableMonitors()

  • HAL_ICACHE_Monitor_Reset() has been renamed to HAL_ICACHE_ResetMonitors()

Rename the monitors values functions.

  • HAL_ICACHE_Monitor_GetHitValue() has been renamed to HAL_ICACHE_GetMonitorHitValue()

  • HAL_ICACHE_Monitor_GetMissValue() has been renamed to HAL_ICACHE_GetMonitorMissValue()